From ea5725a36c19cde5ba314199c130443aba6ac1f6 Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild2.aw" Date: Tue, 23 Jan 2007 12:07:02 -0700 Subject: [PATCH] [IA64] Fix Xen crash when creating VTI domain Xend will do a hypercall to destory domain when creating VTI guest fails. If "is_vti" is not set at that point, HV will call relinquish_vcpu_resource(), which is for non-VTI. It may try to free a NULL pointer, so dom0 crash. This patch fix it. Signed-off-by: Xu Anthony Signed-off-by: Zhang Xin --- xen/arch/ia64/xen/vhpt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/ia64/xen/vhpt.c b/xen/arch/ia64/xen/vhpt.c index c8846efc45..67341328de 100644 --- a/xen/arch/ia64/xen/vhpt.c +++ b/xen/arch/ia64/xen/vhpt.c @@ -177,7 +177,9 @@ pervcpu_vhpt_alloc(struct vcpu *v) void pervcpu_vhpt_free(struct vcpu *v) { - free_domheap_pages(v->arch.vhpt_page, VHPT_SIZE_LOG2 - PAGE_SHIFT); + if (likely(v->arch.vhpt_page != NULL)) + free_domheap_pages(v->arch.vhpt_page, + VHPT_SIZE_LOG2 - PAGE_SHIFT); } #endif -- 2.30.2